import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { configure } from './configure/configure.module';
import * as express from 'express';
import * as chalk from 'chalk';
import { Log4jsService } from "@quickts/nestjs-log4js";
import { Logger } from "@nestjs/common";
async function bootstrap() {
  const logger = new Log4jsService("info");
  const app = await NestFactory.create(AppModule, configure.env == 'product'?{logger}:{});
  app.enableCors();
  app.use(express.urlencoded({ limit: '50mb' }));
  app.use(express.json({ limit: '50mb' }));
  (app as any).useStaticAssets(configure.publicPath);
  
  await app.listen(configure.appPort, () => {
    Logger.log(`APP runing success!port is ${configure.appPort}`, 'APP_INFO')
  });
}
bootstrap();
